<?php
$server = new swoole_server("0.0.0.0", 3333);
$server->set([
   'heartbeat_check_interval' => 5,
   'heartbeat_idle_time' => 15
]);

$server->on('connect', function ($server, $fd) {
   echo "===connect===".PHP_EOL;
});

$server->on("receive", function ($server, $fd, $from_id, $data) {
   echo "receive from {$fd}:{$data}======".PHP_EOL;
});

$server->start();